﻿using System;
using System.Windows.Controls;
using System.Windows.Input;

namespace Infrasturcture.Global.Controls.LobbyMap
{
    public class AMapElement : UserControl
    {
        public event EventHandler<EventArgs> OnTapped; 
        public void HighLight(bool shouldHighlight)
        {
            MouseButtonEventArgs mbea;
            if (shouldHighlight)
            {
                mbea = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left) { RoutedEvent = Mouse.MouseDownEvent };
                RaiseEvent(mbea);
                if (OnTapped != null)
                {
                    OnTapped(this, new EventArgs());
                }
            }
            else
            {
                mbea = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left){RoutedEvent = Mouse.MouseUpEvent};
                RaiseEvent(mbea);
            }
        }
    }
}
